#ifdef HERZELEID_DESKTOP
 #if _MSC_VER
  #pragma once
 #endif

 #ifndef __HERZELEID_RECT_INCLUDED__
  #define __HERZELEID_RECT_INCLUDED__
  #include "HerzeleidPrecompiled.hxx"
  #include "HerzeleidFoundation.hxx"
  #include "HerzeleidPoint.hxx"
  #include "HerzeleidSize.hxx"
#include "HerzeleidTypedEvent.hxx"

HerzeleidFoundationNamespaceBegin class Rect : public Point, public Size
{
public:

	Rect( _In_ Float32 X, _In_ Float32 Y, _In_ Float32 Width, _In_ Float32 Height );
	Rect( _In_ Point Point1, _In_ Point Point2 );
	Rect( _In_ Point Point, _In_ Size Size );
	Rect( _In_ RECT Rect );

	// Basic operations with the rectangles

	Rect const UnionOf( _In_ Rect Other ) const;
	Rect const UnionOf( _In_ Point Other ) const;
	Rect const IntersectionOf( _In_ Rect Other ) const;
	bool const Constains( _In_ Point Other ) const;
	bool const IntersectsWith( _In_ Rect Other ) const;

	DeclGetPropOnly(BoolConst, IsEmpty );
	DeclConstTypedGetterFor( BoolConst, IsEmpty )
	{
		return((!Width) && (!Height));
	};

	DeclGetPropOnly( Float32Const, Bottom );
	DeclConstTypedGetterFor( Float32Const, Bottom )
	{
		return (Y + Height);
	}

	DeclGetPropOnly( Float32Const, Left );
	DeclConstTypedGetterFor( Float32Const, Left )
	{
		return (X);
	}

	DeclGetPropOnly( Float32Const, Right );
	DeclConstTypedGetterFor( Float32Const, Right )
	{
		return (X + Width);
	}

	DeclGetPropOnly( Float32Const, Top );
	DeclConstTypedGetterFor( Float32Const, Top )
	{
		return (Y);
	}

	static const Rect Empty();

	void operator= (RECT const &Other);

} HerzeleidFoundationNamespaceEnd;

HerzeleidFoundationNamespaceBegin
	TinyTypeDecl( Rect );
    TypeDecl( RECT, __rect, RawRect );
HerzeleidFoundationNamespaceEnd

 #endif // !HERZELEID_RECT_INCLUDED__
#endif // !HERZELEID_DESKTOP